package Utils;

public class MathDemo {
    public static void main(String[] args) {
        System.out.println(Math.abs(-12.7));
        System.out.println(Math.random());
        System.out.println(Math.max(2, 3));
        System.out.println(Math.min(4, 6));
        // index and log
        System.out.println(Math.sqrt(4));
        System.out.println(Math.pow(2, 2));
        System.out.println(Math.log(4));
        // rounding
        System.out.println(Math.ceil(12.7));
        System.out.println(Math.floor(12.7));
        System.out.println(Math.round(12.7));
        System.out.println(Math.rint(12.7));
        // trigonometric function
        System.out.println("sin30 = " + Math.sin(Math.PI / 6));
        System.out.println("cos30 = " + Math.cos(Math.PI / 6));
        System.out.println("tan30 = " + Math.tan(Math.PI / 6));
        System.out.println("arcsin(0.5) = " + Math.asin(0.5));
        System.out.println("arccos(0.5) = " + Math.acos(0.5));
        System.out.println("arctan(0.5) = " + Math.atan(0.5));
    }
}
